<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of TradeModel
 *
 * @author Administrator
 */
namespace Qwadmin\Model;
use Think\Model;
class CodeModel extends Model {
    
    function getcode($pid=0){
        $tradeList = M('code')->where(array('pid'=>$pid))->cache(true,1000)->group('code')->select();
        $temp=array();
        foreach($tradeList as $key=>$val){
            $temp[$val['code']] = $val['name'];
        }
        return $temp;
    }
	
 
}
